package objbo.xmlparser.view.ui;

import objbo.xmlparser.model.bean.ElementBean;
import objbo.xmlparser.view.interfaces.InterFaceMain;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;

public class MainUI extends Composite implements IParserUI
{


	
	private InterFaceMain interfaces = null;
	
	public MainUI(Composite parent)
	{
		super(parent, SWT.NONE);
		interfaces = new InterFaceMain();
		initComposite();
	}

	private void initComposite()
	{
		XMLTreeUI leftUI = null;
		FormData leftUILayoutData = null;
		
		
		
		TabUI upUI = null;
		FormData upUILayoutData = null;
		
		
		
		FileControlUI downUI = null;
		FormData downUILayoutData = null;
		
		Layout layout = null;
		
		
		try
		{
						
						
			layout = new FormLayout();
			this.setLayout(layout);
			
					
			
			leftUI = this.interfaces.getUIInterFace().makeTreeUI(this);
			
			leftUILayoutData = new FormData();
			leftUILayoutData.top = new FormAttachment(0, 5);
			leftUILayoutData.left = new FormAttachment(0, 5);
			leftUILayoutData.right = new FormAttachment(50, -5);
			leftUILayoutData.bottom = new FormAttachment(100,-5);
			
			leftUI.setLayoutData(leftUILayoutData);
			
			
			
			upUI = this.interfaces.getUIInterFace().makeTabUI(this);
			
			upUILayoutData = new FormData();
			upUILayoutData.top = new FormAttachment(0, 5);
			upUILayoutData.left = new FormAttachment(leftUI);
			upUILayoutData.right = new FormAttachment(100, -5);
			upUILayoutData.bottom = new FormAttachment(80,-5);
			
			upUI.setLayoutData(upUILayoutData);
			
			
			downUI = this.interfaces.getUIInterFace().makeFileControlUI(this);
			
			downUILayoutData = new FormData();
			downUILayoutData.top = new FormAttachment(upUI);
			downUILayoutData.left = new FormAttachment(leftUI);
			downUILayoutData.right = new FormAttachment(100, -5);
			downUILayoutData.bottom = new FormAttachment(100);
			
			downUI.setLayoutData(downUILayoutData);
			
			this.pack();
			
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		finally
		{

		}
	}
	
	
	

	
	
	

}
